<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
		<link href="css/background.css" rel="stylesheet" type="text/css" />
		<link href="css/table.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="js/openwindow.js"></script>
		<style>
		.small{font-size:12px; color:#000;}
.name{font-size:16px; font-weight:bold; color:#03F}
.firm{font-weight:bold; font-size:17px;color: #000 }
		</style>
	</head>
	<script type="text/javascript">
	function page(currentPage){
		$("#page").val(currentPage);
		document.pageForm.submit();
	}
	
	function clearall(){
		$("#name").val("");
		$("#policeNumber").val("");
		document.queryBookForm.submit();
	}
	$(function(){
	var currentPage=$("#currentPage").val()
	var totalPage=$("#totalPage").val();
	if(parseInt(currentPage)<=1){
		$("#upPage").attr("disabled","disabled");
	}
	if(parseInt(currentPage)>=parseInt(totalPage)){
		$("#downPage").attr("disabled","disabled");
	}
});

function changePage(){
	var nextPage=$("#toPage").val()
	var totalPage=$("#totalPage").val();
	var reg=/^([1-9]+[0-9]*)$/;
	if(!reg.exec(nextPage)){
		alert("请正确输入页数");
		$("#nextPage").val(1);
		return;
	}else {
	if(nextPage==''||parseInt(nextPage)==0){
		nextPage=1;
	}else if(parseInt(nextPage)>parseInt(totalPage)){
		nextPage=totalPage;
	}
	}
	page(nextPage);
}

function pageTo(val){
	page(val);
}
</script>
	<body>
		<div class="topdiv">
			<form action="bookList.action" name="queryBookForm" method="post">
				<div >
					姓名：
					<input type="text" id="name" name="name" value="${name}" />
					&nbsp;&nbsp;警员号：
					<input type="text" id="policeNumber" name="policeNumber" value="${policeNumber}" />
				</div>
				<table align="right">
				 <tr>
					<td>
						<input class="button_04" type="submit" value="立即查找" />
				 		<input align="right"  class="button_02" type="button" onclick="clearall()" value="清除" />
					</td>
				 </tr>
				</table>
			</form>
		</div>
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tbody>
				<tr>
					<td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
					<td style="background: url('image/wsoa_window_002.gif');">
						<table border="0" cellpadding="0" cellspacing="0">
							<tbody>
								<tr>
									<td align="center"
										style="background: url('image/wsoa_window_002.gif');"
										width="10">
										<img src="image/center_19.gif">
									</td>
									<td align="center"
										style="background: url('image/wsoa_window_002.gif');"></td>
									<td>
										个人办公 &gt; 我的办公桌 &gt; 通讯录
									</td>
								</tr>
							</tbody>
						</table>
					</td>
					<td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
				</tr>
				<tr>
					<td style="background: url('image/wsoa_window_010.gif');" width="1">
						&nbsp;
					</td>
					<td>
						<c:forEach items="${users}" var="user" varStatus="count">
							<div style="float: left; background: url(image/card.png) no-repeat; width: 300px; height: 199px;margin-left: 10px">
								<table width="100%" height="234">
									<tr>
										<td colspan="2" height="50px" valign="top" align="center" style="line-height: 55px">
											<font class="firm" >${empty user.orgName ? '没有部门' : user.orgName}</font>
										</td>
									</tr>
									<tr>
										<td valign="top" width="30%">
											<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top:10px;margin-left: 10px">
												<tr>
													<td height="25" valign="top" nowrap>
														<table align="left" border="0" width="100px">
															<tr>
															<td align="center" style="text-align: center"> 
															<font title="${user.name }"  class="name">${fn:substring(user.name,0,7)}</font>&nbsp;
															</td>
															</tr>
															<tr>
															<td  style="text-align: center">
																<font class="small">${empty user.position?'民警':user.position}</font>
																</td>
															</tr>
															<tr>
															<td valign="top"  style="text-align: center">
																<font class="small">警号:${user.account }</font>
															</td>
														</tr>
															
														</table>
													</td>
												</tr>
											</table>
										</td>
										<td  valign="top" >
											<table  width="100%" border="0" cellpadding="0" cellspacing="0" >
												<tr>
													<td height="46" valign="top">
														<ul style="list-style-type: none; margin-top: 12px">
															<li class="small">
																手机：${empty user.phone?'无':user.phone }
															</li>
															<li>
																电话：${empty user.telephone?'无':user.telephone }
															</li>
															<li class="small">
																邮件：${empty user.email?'无':user.email}
															</li>
															<li class="small">
																<a href="mail.action?userId=${user.id }"><img
																		src="image/mail.png" width="20px" height="20px"
																		border="0px" title="发送邮件">
																</a>&nbsp;&nbsp;
																
															</li>
														</ul>
													</td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</div>
						</c:forEach>

					</td>
					<td style="background: url('image/wsoa_window_006.gif');" width="1">
						&nbsp;
					</td>
				</tr>
				<tr>
					<td height="1" width="1">
						<img src="image/wsoa_window_009.gif" height="16" width="14">
					</td>
					<td style="background: url('image/wsoa_window_008.gif');"
						height="1"></td>
					<td height="1" width="1">
						<img src="image/wsoa_window_007.gif" height="16" width="12">
					</td>
				</tr>
			</tbody>
		</table>
		<div class="pageDiv">
			<form action="bookList.action" name="pageForm" method="post">
				<input type="hidden" name="name" id="name" value="${name}" />
				<input type="hidden" id="policeNumber" name="policeNumber" value="${policeNumber}" />
				<input type="hidden" id="page" name="currentPage" />
				<input id="currentPage" type="hidden" value="${currentPage}">
		<input id="totalPage" type="hidden" value="${pageCount}">
		<table align="right">
	<tbody>
		<tr>
			<td>
				<span id="form:data1_scroller_rowCount">共<font style="color: red; font-weight: bold;">${totalCount}</font>条，</span><span
					id="form:data1_scroller_pageCount">共<font
					style="color: red; font-weight: bold;">${pageCount}</font>页，</span>
					<span id="form:data1_scroller_outtext4">每页12</span>
				    <span id="form:data1_scroller_outtext6"> 条，</span>
				    <span id="form:data1_scroller_outtext5">当前第 </span>
				<input id="toPage" value="${currentPage}" size="3"
					onkeydown="if(event.keyCode==13){changePage();}"
					style="width: 20px;"
					type="text">
				<input  
					value="跳转" onclick="changePage()" title="跳转"
					class="button_goto" accesskey="j" type="button">
				<span id="form:data1_scroller_outtext7">页</span>
			</td>
			<td>
				<table class="">
					<tbody>
						<tr>
							<td>
								<input value="首页" title="首页" style="cursor: hand;" onclick="pageTo('1')"  class="button_02" accesskey="f" type="button">
							</td>
							<td>
								<input id="upPage" value="上页" onclick="pageTo('${currentPage-1}')"	title="上页" style="cursor: hand;" class="button_02" accesskey="p" type="button">
							</td>
							<td>
									<input id="downPage" value="下页" onclick="pageTo('${currentPage+1}')"	title="下页" class="button_02" style="cursor: hand;" accesskey="n" type="button">
							</td>
							<td>
								<input value="末页" onclick="pageTo('${pageCount}')" title="末页" style="cursor: hand;" class="button_02" accesskey="l" type="button">
							</td>
						</tr>
					</tbody>
				</table>
			</td>
		</tr>
	</tbody>
</table>
			</form>
		</div>
	</body>
</html>